package com.macro.mall.commission.enums;

/**
 * 分佣类型枚举
 *
 * @author xuyanjun
 * @date 2019-09-02
 */
public enum AssignTypeEnum {

    /**
     * 小二收益1
     */
    WAITER_1(5, "小二收益1"),

    /**
     * 小二收益2
     */
    WAITER_2(10, "小二收益2"),

    /**
     * 掌柜收益1
     */
    SHOP_KEEPER_1(15, "掌柜收益1"),

    /**
     * 掌柜收益2
     */
    SHOP_KEEPER_2(20, "掌柜收益2"),

    /**
     * 东家收益1
     */
    SHOP_OWNER_1(25, "东家收益1"),

    /**
     * 东家收益2
     */
    SHOP_OWNER_2(30, "东家收益2"),

    /**
     * 淘客/老太爷收益
     */
    TK(35, "淘客/老太爷收益");

    /**
     * 值
     */
    private int value;

    /**
     * 描述
     */
    private String description;

    AssignTypeEnum(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public static AssignTypeEnum enumOf(int v) {
        for (AssignTypeEnum assignTypeEnum : values()) {
            if (assignTypeEnum.value == v) {
                return assignTypeEnum;
            }
        }
        throw new IllegalArgumentException("不合法的分佣类型枚举值:" + v);
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

}
